<?php
//NEW MESSAGES
$msg_count = mysql_num_rows(safe_query("SELECT * FROM message WHERE receiver='".$userID."' AND isread='0'"));
if($msg_count) {
$new_msg = '<span class="note">'.$msg_count.'</span>';
}

//MESSAGES
$messages = safe_query("SELECT * FROM message WHERE receiver='".$userID."' ORDER by date LIMIT 0,5");
$messages_list = '';
while($msg = mysql_fetch_array($messages))
{
$title = cut($msg['title'], 25);
$content = cut($msg['content'], 60);
eval ("\$msg_list = \"".gettemplate("msg_list")."\";");
$messages_list .= $msg_list;
}
?>